<?php

namespace app\api\model;

use think\admin\Model;

class DataCity extends Model
{
    public static function getDetail(string $field = '', $where = []): array
    {
       return self::mk()->where($where)->field($field)->find()->toArray();
    }
    public static function getLists(string $field = '', $where = []): array
    {
       return self::mk()->where($where)->field($field)->select()->toArray();
    }
    public static function getProvince($id): string
    {
       return self::mk()->where(['adcode'=>$id])->value('name')??'';
    }
    public static function getCity($id): string
    {
       return self::mk()->where(['adcode'=>$id])->value('name')??'';
    }
    public static function getDistrict($id): string
    {
       return self::mk()->where(['adcode'=>$id])->value('name')??'';
    }
}
